<?php
if (!defined('DP_BASE_DIR')) {
	echo 'You should not call this function directly!';
}
else {
	$task_id = $_GET['task_id'];
	$op = $_GET['op'];
	$sql = $op == '1' ?
		"INSERT INTO user_task_pin (user_id, task_id) VALUES({$AppUI->user_id}, $task_id)" :
		"DELETE FROM user_task_pin WHERE user_id={$AppUI->user_id} AND task_id=$task_id";

	echo !db_exec( $sql ) ? 'Error' : 'OK';
}
?>
